package com.example.prototype.shape;

import jdk.nashorn.internal.objects.annotations.Getter;

/**
 * @Description TODO浅拷贝实现 Cloneable，重写，深拷贝是通过实现 Serializable 读取二进制流。
 * @Date 2021/10/28 15:06
 * @Author ZhangJi
 * @Version 1.0
 */
public abstract class Shape implements Cloneable{

  private String id;

  protected String type;

  public String getId() {
    return id;
  }

  public String getType() {
    return type;
  }

  public void setId(String id) {
    this.id = id;
  }

  /**
   * 绘画方法
   */
  public abstract void draw();

  @Override
  public Object clone() {
    Object clone = null;
    try {
      clone = super.clone();
    } catch (CloneNotSupportedException e) {
      e.printStackTrace();
    }
    return clone;
  }

}
